home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / INTERNET.H < prev    next >
C/C++ Source or Header  |  1990-01-26  |  1KB  |  51 lines

  1. /* Global structures and constants pertaining to the interface between IP and
  2.  *     higher level protocols
  3.  */
  4.  
  5. /* IP protocol field values */
  6. #define    ICMP_PTCL    1    /* Internet Control Message Protocol */
  7. #define    TCP_PTCL    6    /* Transmission Control Protocol */
  8. #define    UDP_PTCL    17    /* User Datagram Protocol */
  9.  
  10. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  11.  
  12. /* DoD-style precedences */
  13. #define    ROUTINE        0x00
  14. #define    PRIORITY    0x20
  15. #define    IMMEDIATE    0x40
  16. #define    FLASH        0x60
  17. #define    FLASH_OVER    0x80
  18. #define    CRITIC        0xa0
  19. #define    INET_CTL    0xc0
  20. #define    NET_CTL        0xe0
  21.  
  22. /* Amateur-style precedences */
  23. #define    AM_ROUTINE    0x00
  24. #define    AM_WELFARE    0x20
  25. #define    AM_PRIORITY    0x40
  26. #define    AM_EMERGENCY    0x60
  27.  
  28. /* Class-of-service bits */
  29. #define    LOW_DELAY    0x10
  30. #define    THROUGHPUT    0x08
  31. #define    RELIABILITY    0x04
  32.  
  33. /* IP TOS fields */
  34. #define    PREC(x)        (((x)>>5) & 7)
  35. #define    DELAY        0x10
  36. #define    THRUPUT        0x8
  37. #define    RELIABLITY    0x4
  38.  
  39. /* Pseudo-header for TCP and UDP checksumming */
  40. struct pseudo_header {
  41.     int32 source;        /* IP source */
  42.     int32 dest;        /* IP destination */
  43.     int16 protocol;        /* Protocol (padded to 16 bits!) */
  44.     int16 length;        /* Data field length */
  45. };
  46. #define    NULLHEADER    (struct pseudo_header *)0
  47.  
  48. void tcp_input(),udp_input(),dump_ip();
  49. int16 cksum();
  50. int ip_send();
  51.